Contents
Introduction
Guide Organization
Overview of the AutoCAD .NET
API
Components of the AutoCAD .NET
API
Overview of Microsoft Visual
Studio
Which Edition of Microsoft
Visual Studio to Use
Use COM Interoperability
with .NET
Dependencies and Restrictions
For More Information
Sample Code
Transition from ActiveX
Automation to .NET
Getting Started with Microsoft
Visual Studio
Understand Microsoft Visual
Studio Projects
Define the Components in
a Project
View Project Information
Work with Microsoft Visual
Studio Projects
Create a New Project
Open an Existing Project
or Solution
Save a Project or Solution
Work with Multiple Projects
in a Solution
Edit an Existing Project
or Solution
Add New Items
Import Existing Items
Edit Items
Use the Code Window
Use the Windows Form Designer
Use the Properties Window
Rename a Project
Add and Reference Other
Projects
Set the Options for Microsoft
Visual Studio
Load an Assembly into AutoCAD
Access and Search Referenced
Libraries (Object Browser)
Exercises: Create Your
First Project
Exercise: Create a New
Project
Exercise: Reference the AutoCAD .NET
API Files
Exercise: Create a New
Command
Exercise: Set the Target
Framework for a Project
Exercise: Build and Load
a .NET Assembly in AutoCAD
Related AutoCAD Commands
and Terminology
More Information
Basics of the AutoCAD .NET
API
Understand the AutoCAD Object Hierarchy
The Application Object
The Document Object
The Database Object
The Graphical and Nongraphical
Objects
The Collection Objects
Non-Native Graphical and
Nongraphical Objects
Access the Object Hierarchy
Reference Objects in the
Object Hierarchy
Access the Application
Object
Collection Objects
Access a Collection
Add a New Member to a Collection
Object
Iterate through a Collection
Object
Erase a Member of a Collection
Object
Understand Properties and
Methods
Out-of-Process versus In-Process
Define Commands and AutoLISP
Functions
Command Definition
AutoLISP Function Definition
Control the AutoCAD Environment
Control the Application
Window
Control the Drawing Windows
Position and Size the Document
Window
Zoom and Pan the Current
View
Manipulate the Current
View
Define to Window
Scale a View
Center Objects
Display Drawing Extents
and Limits
Use Named Views
Use Tiled Viewports
Identify and Manipulate
the Active Viewport
Make A Tiled Viewport Current
Update the Geometry in
the Document Window
Create, Open, Save, and
Close Drawings
Create and Open a Drawing
Save and Close a Drawing
Work with No Documents
Open
Lock and Unlock a Document
Set AutoCAD Preferences
Database Preferences
Set and Return System Variables
Draw with Precision
Adjust Snap and Grid Alignment
Use Ortho Mode
Calculate Points and Values
Calculate Areas
Calculate a Defined Area
Prompt for User Input
GetString Method
GetPoint Method
GetKeywords Method
Control User Input
Access the AutoCAD Command
Line
Create and Edit AutoCAD Entities
Open and Close Objects
Work with ObjectIds
Use Transactions with the
Transaction Manager
Start a New Transaction
and Open an Object
Commit and Rollback Changes
Nest Transactions
Open and Close Objects
without the Transaction Manager
Upgrade and Downgrade Open
Objects
Create Objects
Determine the Parent Object
Create Lines
Create a Line Object
Create a Polyline object
Create Curved Objects
Create a Circle object
Create an Arc object
Create a Spline object
Create Point Objects
Create Solid-Filled Areas
Work with Regions
Create Regions
Create Composite Regions
Create Hatches
Create a Hatch Object
Associate a Hatch
Assign the Hatch Pattern
Type and Name
Define the Hatch Boundaries
Work with Selection Sets
Obtain the PickFirst Selection
Set
Select Objects in the Drawing
Area
Add To or Merge Multiple
Selection Sets
Define Rules for Selection
Filters
Use Selection Filters to
Define Selection Set Rules
Specify Multiple Criteria
in a Selection Filter
Add Complexity to Your
Filter List Conditions
Use Wild-Card Patterns
in Selection Set Filter Criteria
Filter for Extended Data
Remove Objects From a Selection
Set
Edit Named and 2D Objects
Work with Named Objects
Purge Unreferenced Named
Objects
Rename Objects
Erase Objects
Copy Objects
Copy an Object
Copy Objects between Databases
Offset Objects
Transform Objects
Move Objects
Rotate Objects
Mirror Objects
Scale Objects
Array Objects
Create Polar Arrays
Create Rectangular Arrays
Extend and Trim Objects
Explode Objects
Edit Polylines
Edit Splines
Edit Hatches
Edit Hatch Boundaries
Edit Hatch Patterns
Use Layers, Colors, and
Linetypes
Work with Layers
Sort Layers and Linetypes
Create and Name Layers
Make a Layer Current
Turn Layers On and Off
Freeze and Thaw Layers
Lock and Unlock Layers
Assign Color to a Layer
Assign a Linetype to a
Layer
Erase Layers
Work with Colors
Assign a color value to
an object
Make a color current through
the database
Make a color current with
the CECOLOR system variable
Work with Linetypes
Make a Linetype Active
Assign a linetype to an
object
Make a linetype current
through the database
Make a linetype current
with the CELTYPE system variable
Rename Linetypes
Delete Linetypes
Change Linetype Descriptions
Specify Linetype Scale
Save and Restore Layer
States
Understand How AutoCAD Saves
Layer States
Use the LayerStateManager
to Manage Layer States
Save Layer States
Rename Layer States
Delete Layer States
Restore Layer States
Export and Import Saved
Layer States
Add Text to Drawings
Work with Text Styles
Create and Modify Text
Styles
Assign Fonts
Use TrueType Fonts
Use Unicode and Big Fonts
Set Text Height
Set Obliquing Angle
Set Text Generation Flag
Use Single-Line Text (Text)
Create Single-Line Text
Format Single-Line Text
Align Single-Line Text
Change Single-Line Text
Use Multiline Text (MText)
Create Multiline Text
Format Multiline Text
Use Unicode Characters,
Control Codes, and Special Characters
Substitute Fonts
Check Spelling
Dimensions and Tolerances
Dimensioning Concepts
Parts of a Dimension
Define the Dimension System
Variables
Set Dimension Text Styles
Understand Leader Lines
Understand Associative
Dimensions
Create Dimensions
Create Linear Dimensions
Create Radial Dimensions
Create Angular Dimensions
Create Jogged Radius Dimensions
Create Arc Length Dimensions
Create Ordinate Dimensions
Edit Dimensions
Override Dimension Text
Work with Dimension Styles
Create, Modify, and Copy
Dimension Styles
Override the Dimension
Style
Dimension in Model Space
and Paper Space
Create Leaders and Annotation
Create Leader Lines
Add the Annotation to a
Leader
Leader Associativity
Edit Leader Associativity
Edit Leaders
Use Geometric Tolerances
Create Geometric Tolerances
Edit Geometric Tolerances
Work in Three-Dimensional
Space
Specify 3D Coordinates
Define a User Coordinate
System
Convert Coordinates
Create 3D Objects
Create Wireframes
Create Meshes
Create Polyface Meshes
Create Solids
Edit in 3D
Rotate in 3D
Array in 3D
Mirror Objects Along a
Plane
Edit 3D Solids
Define Layouts and Plot
Model Space and Paper Space
Layouts
Layouts and Blocks
Plot Settings
Layout Settings
Paper Size and Units
Plot Origin
Plot Area
Plot Scale
Lineweight Scale
Plot Device
Query and Set Layout Settings
Viewports
Floating Viewports
Create Paper Space Viewports
Change Viewport Views and
Content
Scale Views Relative to
Paper Space
Scale Pattern Linetypes
in Paper Space
Use Shaded Viewports
Plot Your Drawing
Plot from Model Space
Plot from Paper Space
Use Events
Understand the Events in AutoCAD
Guidelines for Event Handlers
Register and Unregister
Events
Handle Application Events
Handle Document Events
Handle DocumentCollection
Events
Handle Object Events
Register COM Based Events
with .NET
Develop Applications with
VB.NET and C#
Handle Errors
Define Application Error
Types
Trap Runtime Errors
Use Try Statements
Use the Exception Object
On Error Statements (VB.NET)
Compare Error Handlers
in VBA or VB to .NET
Respond to User Input Errors
Distribute Your Application
VBA/VB to VB.NET and C#
Comparison
VBA to VB.NET and C# Comparison